#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main()
{
	int n, m;
	scanf("%d%d", &n, &m);
	if (n < m)
	{
		int tmp = m;
		m = n;
		n = tmp;
	}
	int x = n, y = m;
	while (n % m != 0)
	{
		int i = m;
		m = n%m;
		n = i;
	}
	int k = (x * y) / m;
	printf("%d %d\n", m, k);

	return 0;
}